package cn.itcast.web.servlet;

import cn.itcast.daomain.commodity;
import cn.itcast.service.UserService;
import cn.itcast.service.impl.UserServiceImpl;

import javax.servlet.*;
import javax.servlet.annotation.*;
import javax.servlet.http.*;
import java.io.IOException;
import java.util.List;

@WebServlet("/groupUserServlet")
public class groupUserServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doPost(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        UserService service=new UserServiceImpl();
        List<commodity> comm= service.finAll();
        request.setAttribute("commgroup",comm);
        request.getRequestDispatcher("/Shopping.jsp").forward(request,response);
    }
}
